
//引入样式
require('../css/commonCss/normalize.css')
require('../css/commonCss/reset.css')
require('../css/commonCss/property.css')
require('../css/commonCss/basic.less')
require('../fonts/iconfont.css')

require('../css/downTime.less')

// 文档加载事件
document.addEventListener('DOMContentLoaded', function () {
    /* 
        0:获取元素
    */
    const box = document.querySelector('.box')
    //定义保存时间
    let time = 3;
    //开启计时器
    let timeId = setInterval(function () {
        //保存时间自减 进行判断
        --time;
        //判断时间在0时候自动跳转
        if (time === 0) {
            box.textContent = 'GO'
        } else if (time === -1) {
            location.href = './sport.html'
            clearInterval(timeId)
        } else {
            //将box渲染到页面中
            box.textContent = time;
        }
    }, 1500)
})